package com.github.springboot.common;

import java.util.List;

/**
 * Created by kjtang on 2018/1/17.
 */
public class Response<T> {

    //响应状态码
    private int code;
    //错误消息
    private String msg;
    //单条数据
    private T data;
    //多条数据
    private List<T> dataList;
    private List<T> errors;

    public static Integer SUCCESS =200;
    public static Integer FAIL = 500;

    public Response(int code){
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public List<T> getDataList() {
        return dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    public List<T> getErrors() {
        return errors;
    }

    public void setErrors(List<T> errors) {
        this.errors = errors;
    }
}
